import request from '@/utils/request'

// 查询列表
export function fetchExpressList(params) {
  return request({
    url: '/admin/expresses',
    method: 'get',
    params
  })
}

// 查询单条
export function fetchExpress(id) {
  return request({
    url: `/admin/expresses/${id}`,
    method: 'get'
  })
}

// 创建
export function createExpress(data) {
  return request({
    url: '/admin/expresses',
    method: 'post',
    data
  })
}

// 修改
export function updateExpress(id, data) {
  return request({
    url: `/admin/expresses/${id}`,
    method: 'put',
    data
  })
}

// 删除
export function deleteExpress(id) {
  return request({
    url: `/admin/expresses/${id}`,
    method: 'delete'
  })
}

// 修改排序
export function ChangeSortExpress(id, data) {
  return request({
    url: `/admin/expresses/${id}/change_sort`,
    method: 'patch',
    data
  })
}
